<%--
  Created by IntelliJ IDEA.
  User: 刘科
  Date: 2020/12/5
  Time: 13:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!--头部信息-->
<header class="lyear-layout-header">

    <nav class="navbar navbar-default">
        <div class="topbar">

            <div class="topbar-left">
                <div class="lyear-aside-toggler">
                    <span class="lyear-toggler-bar"></span>
                    <span class="lyear-toggler-bar"></span>
                    <span class="lyear-toggler-bar"></span>
                </div>
                <span class="navbar-page-title"> 公司介绍信息管理 </span>
            </div>

            <ul class="topbar-right">
                <li class="dropdown dropdown-profile">
                    <a href="javascript:void(0)" data-toggle="dropdown">
                        <img class="img-avatar img-avatar-48 m-r-10" src="../images/users/avatar.jpg"/>
                        <span id="adminName">admin <span class="caret"></span></span>
                    </a>
                    <ul class="dropdown-menu dropdown-menu-right">
                        <li> <a href="edit_pwd.jsp"><i class="mdi mdi-lock-outline"></i> 修改密码</a> </li>
                        <li class="divider"></li>
                        <li > <a href="#!" id="adminLogout"><i class="mdi mdi-logout-variant"></i> 退出登录</a> </li>
                    </ul>
                </li>
            </ul>

        </div>
    </nav>

</header>
<!--End 头部信息-->
<script src="https://cdn.bootcdn.net/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.js"></script>
<script type="text/javascript">
    var admin = JSON.parse(sessionStorage.getItem("admin"));
    if (admin == null) {
        window.location.href=ctx + "admin/admin_login.jsp";
    }
    $("#adminName").text(admin.anName);
    $("#adminLogout").on("click", function () {

        console.log(ctx);
        sessionStorage.clear();
        // $.cookie("admin", null);
        $.removeCookie('admin', { path: '/' });
        window.location.href=ctx + "admin/admin_login.jsp";

    })
</script>
